Skip to content

Add a null pointer check to CCeeGen::GetString - #110742

Closed
BarbonBvv wants to merge 1 commit into
dotnet:mainfrom
BarbonBvv:corecrl-md-cceegen-no-arg-nullcheck-fix
Closed

BarbonBvv wants to merge 1 commit into
dotnet:mainfrom
BarbonBvv:corecrl-md-cceegen-no-arg-nullcheck-fix

Conversation

@BarbonBvv

Copy link
Copy Markdown
Contributor

Add a null pointer check to CCeeGen::GetString
If lpString is NULL, there will be a null pointer access violation.

Found by Linux Verification Center (linuxtesting.org) using SVACE.

If lpString is NULL, there will be a null pointer access violation.

Found by Linux Verification Center (linuxtesting.org) using SVACE.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Dec 16, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@BarbonBvv
BarbonBvv marked this pull request as ready for review December 16, 2024 15:00
@huoyaoyuan

Copy link
Copy Markdown
Member

The case is already handled by if (! lpString). IfFailGo will exit the method.

@jkotas

jkotas commented Dec 16, 2024

Copy link
Copy Markdown
Member

This is dead code. It is best to delete it. Submitted #110749

Thanks!

@jkotas jkotas closed this Dec 16, 2024
@BarbonBvv

Copy link
Copy Markdown
Contributor Author

@huoyaoyuan

The case is already handled by if (! lpString). IfFailGo will exit the method.

No: 'IfFailGo' - will call 'goto' instruction to 'ErrExit:' - and then 'null pointer access violation' should occur.

But anyway, this code will be removed in #110749

@github-actions github-actions Bot locked and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Diagnostics-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants